package com.linkstec.szkettle;

import java.io.File;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;

import org.w3c.dom.Document;
import org.w3c.dom.NodeList;

/**
 * 解析xml文件
 * @author lyl
 *
 */
public class XmlTest {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		   
		   try {
		     File f = new File("conn.xml");
		     DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
		     DocumentBuilder builder = factory.newDocumentBuilder();
		     Document doc = builder.parse(f);
		     NodeList nl = doc.getElementsByTagName("connections");
		     System.out.println(nl);
		    } catch (Exception e) {
		     e.printStackTrace();
		    }
	}
}